let background = null;
-function _createUserSession() {
+function createUserSession() {
// Load the calendar server. Note that we are careful about
// not loading any events until the user presses the clock
global.launch_calendar_server();
_initRecorder();
}
-function _createGDMSession() {
+function createGDMSession() {
// We do this this here instead of at the top to prevent GDM
// related code from getting loaded in normal user sessions
const LoginDialog = imports.gdm.loginDialog;
notificationDaemon = new NotificationDaemon.NotificationDaemon();
windowAttentionHandler = new WindowAttentionHandler.WindowAttentionHandler();
- if (sessionMode.sessionType == Shell.SessionType.USER)
- _createUserSession();
- else if (sessionMode.sessionType == Shell.SessionType.GDM)
- _createGDMSession();
+ sessionMode.createSession();
panel.startStatusArea();
const Lang = imports.lang;
const Shell = imports.gi.Shell;
+const Main = imports.ui.main;
const Params = imports.misc.params;
const DEFAULT_MODE = 'user';
allowKeybindingsWhenModal: true,
hasRunDialog: false,
hasWorkspaces: false,
+ createSession: Main.createGDMSession,
sessionType: Shell.SessionType.GDM },
'user': { hasOverview: true,
allowKeybindingsWhenModal: false,
hasRunDialog: true,
hasWorkspaces: true,
+ createSession: Main.createUserSession,
sessionType: Shell.SessionType.USER }
};
let params = _modes[global.session_mode];
params = Params.parse(params, _modes[DEFAULT_MODE]);
+
+ this._createSession = params.createSession;
+ delete params.createSession;
+
Lang.copyProperties(params, this);
+ },
+
+ createSession: function() {
+ if (this._createSession)
+ this._createSession();
}
});